import Vue from 'vue'
import Router from 'vue-router'
import Nav from '@/admin/nav'
import login from '@/admin/login'
import loginfail from '@/admin/loginfail'
import redirect from '@/admin/redirect'
import system from '@/admin/system/system'
import list from '@/admin/system/list'
import menu from '@/admin/system/menu'
import role from '@/admin/system/role'
import viewRight from '@/admin/system/viewRight'
import modifyRight from '@/admin/system/modifyRight'
import config from '@/admin/system/config'
import blank from '@/admin/blank'
import newsDetail from '@/admin/forum/newsDetail'
import videoNewsDetail from '@/admin/forum/videoNewsDetail'
import memberNewsDetail from '@/admin/forum/memberNewsDetail'
import newsList from '@/admin/forum/newsList'
import newsCategoryList from '@/admin/forum/newsCategory'
import newsAgree from '@/admin/forum/newsAgree'
import newsComment from '@/admin/forum/newsComment'
import link from '@/admin/forum/link'
import ads from '@/admin/forum/ads'
import banner from '@/admin/forum/banner'
import specialAuthor from '@/admin/forum/specialAuthor'
import authorDetail from '@/admin/forum/authorDetail'
import specialColumn from '@/admin/forum/specialColumn'
// import authorNews from '@/admin/forum/authorNews'
import bottomLink from '@/admin/forum/bottomLink'
import homeConfig from '@/admin/forum/homeConfig'
import subject from '@/admin/forum/subject'
import subjectConfig from '@/admin/forum/subjectConfig'
import subjectConference from '@/admin/forum/subjectConference'
import conferenceApply from '@/admin/forum/apply/conferenceApply'
import country from '@/admin/forum/apply/country'
import mediaApply from '@/admin/forum/apply/mediaApply'
import userFavourite from '@/admin/forum/user/userFavourite'
import validateCode from '@/admin/forum/user/validateCode'
import downloadCenter from '@/admin/forum/downloadCenter'
import downloadCenterDetail from '@/admin/forum/downloadCenterDetail'
// import specialColumnAuthor from '@/admin/forum/specialColumnAuthor'
import uploadDemo from '@/admin/forum/uploadDemo'
import validate from '@/web/email/validate'
import index from '@/web/mobile/index'
import detail from '@/web/mobile/detail'
import userpage from '@/web/mobile/user'
import downloadlist from '@/web/mobile/download'
import datalist from '@/web/mobile/list'
import loginpage from '@/web/mobile/components/login'
import ifflist from '@/web/mobile/ifflist'
import authorlist from '@/web/mobile/authorlist'
import authordetail from '@/web/mobile/authordetail'
import conferenceTopics from '@/web/mobile/conferenceTopics'
import search from '@/web/mobile/components/search'
import footernav from '@/web/mobile/components/footernav'
import searchlist from '@/web/mobile/searchlist'
import contactus from '@/web/mobile/contactus'
import copyright from '@/web/mobile/copyright'
import searchtab from '@/web/mobile/components/searchtab'
import nav from '@/web/mobile/components/nav'
import frame from '@/web/pc/components/frame'  // 媒体报名表
import applyFormMedia from '@/web/pc/applyFormMedia'  // 媒体报名表
import applyFormPerson from '@/web/pc/applyFormPerson'
Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/redirect',
      component: redirect
    },
    {
      path: '/admin',
      name: '首页',
      component: blank,
      children: [
        {
          path: '/',
          component: login
        },
        {
          path: 'login',
          component: login
        },
        {
          path: 'loginfail/:type',
          component: loginfail
        },
        {
          path: 'index/:id',
          name: '首页',
          redirect: '/admin/index',
          component: Nav
        },
        {
          path: 'index',
          name: '首页',
          component: Nav,
          children: [
            {
              path: 'system',
              name: '系统设置',
              redirect: '/admin/index/system/list/:id',
              component: system,
              children: [
                {
                  path: 'list/:id',
                  name: '团队管理员列表',
                  component: list
                },
                {
                  path: 'menu/:id',
                  name: '菜单管理',
                  component: menu
                },
                {
                  path: 'role/:id',
                  name: '角色管理',
                  component: role
                },
                {
                  path: 'viewRight/:mid',
                  name: '查看详情',
                  component: viewRight
                },
                {
                  path: 'modifyRight/:rid',
                  name: '设置权限',
                  component: modifyRight
                },
                {
                  path: 'config/:id',
                  name: '配置项记录',
                  component: config
                }
              ]
            }
          ]
        },
        {
          path: 'news',
          name: '新闻管理',
          component: Nav,
          redirect: '/admin/news/list/:id',
          children: [
            {
              path: 'list/:id',
              name: '新闻列表',
              component: newsList
            },
            {
              path: 'editor',
              name: '编辑新闻',
              component: newsDetail
            },
            {
              path: 'video/detail',
              name: '编辑视频',
              component: videoNewsDetail
            },
            {
              path: 'member/detail',
              name: '编辑成员信息',
              component: memberNewsDetail
            },
            {
              path: 'category/list/:id',
              name: '新闻分类列表',
              component: newsCategoryList
            },
            {
              path: 'link/list/:id',
              name: '链接管理',
              component: link
            },
            {
              path: 'ads/list/:id',
              name: '广告位管理',
              component: ads
            },
            {
              path: 'banner/list/:id',
              name: 'banner管理',
              component: banner
            },
            {
              path: 'special/author/list/:id',
              name: '作者管理',
              component: specialAuthor
            },
            {
              path: 'special/author/detail',
              name: '作者详细信息',
              component: authorDetail
            },
            {
              path: 'special/column/list/:id',
              name: '专栏管理',
              component: specialColumn
            },
            {
              path: 'bottom/link/list/:id',
              name: '底部链接管理',
              component: bottomLink
            },
            {
              path: 'home/config/list/:id',
              name: '首页推荐管理',
              component: homeConfig
            },
            {
              path: 'download/center/:id',
              name: '下载中心',
              component: downloadCenter
            },
            {
              path: 'dc/detail',
              name: '编辑下载资料',
              component: downloadCenterDetail
            },
            {
              path: 'news/agree/list/:id',
              name: '新闻点赞记录',
              component: newsAgree
            },
            {
              path: 'comment/list/:id',
              name: '新闻评论记录',
              component: newsComment
            }
          ]
        }, {
          path: 'subject',
          name: '专题管理',
          component: Nav,
          redirect: '/admin/subject/list/:id',
          children: [
            {
              path: 'list/:id',
              name: '专题管理',
              component: subject
            }, {
              path: 'config/list/:id',
              name: '专题推荐管理',
              component: subjectConfig
            }, {
              path: 'conference/list/:id',
              name: '会议专题日程管理',
              component: subjectConference
            }
          ]
        }, {
          path: 'conference',
          name: '报名管理',
          component: Nav,
          redirect: '/admin/conference/apply/:id',
          children: [
            {
              path: 'apply/:id',
              name: '参会报名管理',
              component: conferenceApply
            }, {
              path: 'country/:id',
              name: '国家管理',
              component: country
            }, {
              path: 'media/apply/:id',
              name: '媒体报名管理',
              component: mediaApply
            }
          ]
        }, {
          path: 'user',
          name: '用户管理',
          component: Nav,
          redirect: '/admin/user/favourite/:id',
          children: [
            {
              path: 'favourite/:id',
              name: '用户收藏记录',
              component: userFavourite
            }, {
              path: 'validate/code/:id',
              name: '校验码管理',
              component: validateCode
            }
          ]
        }
      ]
    },
    {
      path: '/email',
      name: '激活',
      component: blank,
      children: [
        {
          path: 'validate',
          component: validate,
          name: '激活邮箱'
        }
      ]
    },
    {
      path: '/home',
      name: '首页',
      component: blank,
      children: [
        {
          path: '/',
          component: index,
          name: '首页'
        },
        {
          path: 'detail',
          component: detail,
          name: '详情页'
        },
        {
          path: 'list',
          component: datalist,
          name: '列表页'
        },
        {
          path: 'downlist',
          component: downloadlist,
          name: '下载中心'
        },
        {
          path: 'userpage',
          component: userpage,
          name: '用户中心'
        },
        {
          path: 'loginpage',
          component: loginpage,
          name: '登录注册'
        },
        {
          path: 'ifflist',
          component: ifflist,
          name: 'IFF列表页'
        },
        {
          path: 'authorlist',
          component: authorlist,
          name: 'IFF作者列表页'
        },
        {
          path: 'authordetail',
          component: authordetail,
          name: 'IFF作者详情'
        },
        {
          path: 'conferencetopics',
          component: conferenceTopics,
          name: '专题'
        },
        {
          path: 'search',
          component: search,
          name: '搜索'
        },
        {
          path: 'searchlist',
          component: searchlist,
          name: '搜索'
        },
        {
          path: 'upload',
          component: uploadDemo,
          name: '上传'
        },
        {
          path: 'searchtab',
          component: searchtab,
          name: '搜索'
        },
        {
          path: 'nav',
          component: nav,
          name: '导航'
        },
        {
          path: 'footernav',
          component: footernav,
          name: '底部导航'
        },
        {
          path: 'contactus',
          component: contactus,
          name: '联系我们'
        },
        {
          path: 'copyright',
          component: copyright,
          name: '版权声明'
        }
      ]
    },
    {
      path: '/pc',
      name: '首页',
      component: blank,
      children: [
        {
          path: '/apply',
          component: frame,
          name: '底部导航'
        },
        {
          path: '/applyFormMedia',
          component: applyFormMedia,
          name: '媒体报名'
        },
        {
          path: '/applyFormPerson',
          component: applyFormPerson,
          name: '参会报名'
        }
      ]
    },
    {
      path: '/',
      component: blank,
      name: '首页',
      redirect: '/home'
    }, {
      path: '*',
      component: blank,
      name: '首页',
      redirect: '/home'
    }
  ]
})
